from random import randit
xa = -7
ya = -8
xb = 5
yb = -8
xc = 5
yc = 5
xd = -7
yd = 5
mnx = min(xa, xb, xc, xd)
mxx = max(xa, xb, xc, xd)
mny = min(ya, yb, yc, yd)
mxy = max(ya, yb, yc, yd)
n = int(input())
if n <= 0:
    print("Некорректное значений!")
    sys.exit()
cnt = 0
for i in range(5):
    xt = int(input())
    yt = int(input())
    if (mnx <= xt <= mxx) and (mny <= yt <= mxy):
        cnt = cnt+1
print("Количество выстрелов:", n)
print("Количество попаданий:", cnt)
